package com.yuanduo_app.manager;

import android.app.Application;

import com.didichuxing.doraemonkit.DoraemonKit;
import com.didichuxing.doraemonkit.kit.AbstractKit;
import com.xujl.fastlib.utils.ConfigManager;

import java.util.ArrayList;
import java.util.List;

import me.yokeyword.fragmentation.Fragmentation;

/**
 * 调试管理器
 */
public class DebugManager {

    public void init (Application application) {
        if (!ConfigManager.getInstance().isDebug()) {
            return;
        }
        Fragmentation.builder()
                // 显示悬浮球 ; 其他Mode:SHAKE: 摇一摇唤出   NONE：隐藏
                .stackViewMode(Fragmentation.NONE)
                .debug(true)
                .install();
        //开发调试组件
        List<AbstractKit> kits = new ArrayList<>();
        kits.add(new ChangUrlKit());
        kits.add(new TestlKit());
        DoraemonKit.install(application, kits);

    }

    public static DebugManager getInstance () {
        return Holder.MANAGER;
    }

    private DebugManager () {
    }


    private static class Holder {
        private static final DebugManager MANAGER = new DebugManager();
    }
}
